package com.example.vocab.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/login").setViewName("login");
        registry.addViewController("/first").setViewName("first");
        registry.addViewController("/testWord").setViewName("testWord");
        registry.addViewController("/result").setViewName("result");
        registry.addViewController("/").setViewName("login");
        registry.addViewController("/learn").setViewName("learn");
        registry.addViewController("/register").setViewName("register");
        registry.addViewController("/learn").setViewName("learn");
        registry.addViewController("/fast").setViewName("fast");
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
    }
}